home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource Library: Multimedia
/
Resource Library: Multimedia.iso
/
hypercrd
/
xcmds
/
dvlprstc.hqx
/
Developer Stack 1.3r
/
card_6103.txt
< prev
next >
Wrap
Text File
|
1991-04-30
|
3KB
|
144 lines
-- card: 6103 from stack: in.3r
-- bmap block id: 0
-- flags: 4000
-- background id: 2612
-- name: SoundCapToRes
-- part 2 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=187 top=233 right=283 bottom=270
-- title width / last selected line: 0
-- icon id / first selected line: 27056 / 27056
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Try It
----- HyperTalk script -----
on mouseUp
if the optionkey is down then pass mouseup
put "This lets you convert soundcap or soundwave sounds and install them."
-- get the name of the original sound file
answer "You may now select the sound file" with "Cancel" or "OK"
if it = "Cancel" then
play oops
hide message window
exit mouseup
end if
put filename(FSSD) into SoundName
if SoundName is empty then
hide message window
play oops
exit mouseup
end if
put quote&SoundName"e into SoundName
-- get the sampling rate (between 1 and 4)
ask "What sample rate should be used? (1,2,3 or 4)" with "2"
if it <1 or it >4 then
play oops
hide message window
exit mouseup
end if
if it =1 then put 60 into it else
if it =2 then put 72 into it else
if it =3 then put 79 into it else put 84 into it
end if
end if
put it into SampleRate
-- let user name the sound resource
ask "What do you want to name this sound?"
if it is empty then
play oops
hide message window
exit mouseup
end if
put it into ResName
-- get the name of the destination stack
put "Please select the destination stack"
put filename ("STAK") into Destination
if Destination is empty then
hide message window
play oops
exit mouseup
end if
put quote&Destination"e into Destination
-- do the conversion using the XCMD 'SoundCaptoRes'
-- SoundCapToRes takes four arguments:
-- the name you want to call the sound
-- the file that contains the SoundCap output (in quotes)
-- the stack in which you want to put the sound
-- the base pitch of the sound (60, 72, 79, or 84)
put ResName into Args
put ","&SoundName after Args
put ","&Destination after Args
put ","&SampleRate after Args
do "SoundCaptoRes" && Args
-- go to the target stack and test the sound
push card
go to Destination
play ResName
repeat while the sound is not "done"
end repeat
pop card
end mouseUp
-- part contents for background part 13
----- text -----
3
-- part contents for background part 2
----- text -----
SoundCapToRes
-- part contents for background part 3
----- text -----
This will convert a SoundCap or SoundWave file into a 'snd' resource and install it into a specified stack.
Thanks to:
? (If anyone knows who wrote this please pass the information on so proper credit can be given.)
-- part contents for background part 10
----- text -----
Syntax:
SoundCapToRes <ResourceName>,
<SourceFile>,<DestinationFile>,
<SampleRate>
<ResourceName> is the name of the SND resource to be created.
<SourceFile> is the path name of the original sound file to be converted.
<DestinationFile> is the path name of the file to install the SND resource into.
<SampleRate> is the rate at which the sound should be played.
-- part contents for background part 30
----- text -----
XCMD